-
Notifications
You must be signed in to change notification settings - Fork 349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove lingering nb/sb ctl calls from the code base #2697
Conversation
0ecbe76
to
40ad9df
Compare
e9ade69
to
ea871b8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some minor things.
b8b0007
to
f16f210
Compare
NOTE: I had an all green CI run on by local fork here -> https://github.com/astoycos/ovn-kubernetes/actions/runs/1560092606 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good stuff! Just some small-ish comment, Andrew.
}, | ||
}, | ||
{ | ||
Model: meter, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the unlikely scenario that meter already had a meterBand, consider making this a mutateInsert opeartion?
Otherwise maybe we should call this fcn as ... 'CreateMeterAndSetMeterBand' ?!? Maybe not, that is ugly :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well we assume if we're in the function the meter didn't exist, and we're also assuming that if the meter didn't exist that the meterBand doesn't exist either (since there's no way to lookup the meterband without looking up the meter)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general worried about making libovsdb clients on the node code. It will for sure break upgrades because node will upgrade first, try to connect to an older schema and fail to validate the client's schema expectation. I think we should figure out if we want libovsdb clients from the nodes and if the answer is yes, then we will need something like ovn-org/libovsdb#257
go-controller/hybrid-overlay/cmd/hybrid-overlay-node/hybrid-overlay-node.go
Outdated
Show resolved
Hide resolved
@@ -374,7 +375,7 @@ func (m *MasterController) setupHybridLRPolicySharedGw(nodeSubnets []*net.IPNet, | |||
|
|||
if len(logicalRouterPolicyRes) == 0 { | |||
logicalPort := ovntypes.RouterToSwitchPrefix + nodeName | |||
if err := util.CreateMACBinding(logicalPort, ovntypes.OVNClusterRouter, portMac, drIP); err != nil { | |||
if err := util.CreateMACBinding(m.sbClient, logicalPort, ovntypes.OVNClusterRouter, portMac, drIP); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note to self: Remove final sbctl calls from Hybrid Overlay commit looks good
Waiting a bit for any more comments here before taking out the node process libovsdb commits :( |
@astoycos so, yeah there are some OVN calls in the HO Linux... I think it's fine to pass an NBClient into NewNode/newNodeController and use that in the Linux code, because we never run standalone HO binary on Linux. Windows wouldn't use it anyway since it doesn't talk to OVN at all, so we can just pass |
f16f210
to
0458314
Compare
I've taken out the bits where I started making libovsdbclients per node, specifically in the HO node controller and ovnkube-node code, where we still will use however it would be nice if we could run the libovsdb-clients in a no-cache mode so that we could be consistent in it's use across the codebase |
0458314
to
ddb344e
Compare
Here's a quick summary of where we are still using nb/sbctl commands in the code base following this PR
The util functions to support the above raw nb/sbctl calls are found in the |
9ca22b5
to
a0b1625
Compare
a0b1625
to
fad115e
Compare
go-controller/cmd/ovnkube/ovnkube.go
Outdated
@@ -286,7 +290,6 @@ func runOvnKube(ctx *cli.Context) error { | |||
// start the prometheus server to serve OVN Metrics (default port: 9476) | |||
// Note: for ovnkube node mode dpu-host no ovn metrics is required as ovn is not running on the node. | |||
if config.OvnKubeNode.Mode != types.NodeModeDPUHost && config.Kubernetes.OVNMetricsBindAddress != "" { | |||
metrics.RegisterOvnMetrics(ovnClientset.KubeClient, node) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@girishmg iirc you put the metrics in the node because in upstream/nvidia you run OVN DB on its own node so running it on master isnt feasible. Is my memory correct? Maybe we should put the ovn metrics into ovn-dbchecker?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@trozet that is correct. To enable rolling updates, this is the split we have:
|-------------+-----------------------------+-----------|
| Kind | Pod | Component |
|-------------+-----------------------------+-----------|
| Statefulset | ovn-nbdb | OVN |
| Statefulset | ovn-sbdb | OVN |
| Daemonset | ovn-host | OVN |
| Deployment | ovn-northd (replicas=3) | |
|-------------+-----------------------------+-----------|
| Deployment | ovnkube-master (replicas=3) | OVN-K8s |
| Daemonset | ovnkube-node | OVN-K8s |
|-------------+-----------------------------+-----------|
There was also requirement from both RH and NVDA that we reduce the number of TCP Ports from which we expose prometheus metrics. If we have more TCP Ports, then we need equal instances of rbac-proxy to terminate TLS. So, we moved all the OVN/OVS/Ovnkube-node metric collection to ovnkube-node.
Ovnkube-master still continues to export it's metric
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@girishmg what do you think about putting the metrics on ovndbchecker?
Convert the creation/ configuration of the OVN meter and meter_band objects for the acl-logging feature to libovdb Signed-off-by: astoycos <[email protected]>
Set the `controller_event` option on the nb_global table to `true` with libovsdb Signed-off-by: astoycos <[email protected]>
Convert all remaining nbctl calls from the hybridOverlay package Update unit test accordingly Signed-off-by: astoycos <[email protected]>
Remove the final sbctl calls regarding mac_bindings from the hybrid overlay code and convert to libovsdb Ensure we index mac_binding by both possible options, the `logical_port` OR `ip` columns Signed-off-by: astoycos <[email protected]>
Remove some erronous fexec calls Remove the NBtxn struct and associated helper functions Signed-off-by: astoycos <[email protected]>
Remove all of the unused nb/sb ctl helper functions from the util package and add notes on when the rest can be removed Signed-off-by: astoycos <[email protected]>
Move the libovsdbops package out of the `go-controller/pkg/ovn` directory and into `go-controller/pkg` since its used by many packages in the directory. Signed-off-by: astoycos <[email protected]>
fad115e
to
cd445c5
Compare
For now until we decide what to do with the ovn_db metrics I removed the commit from this PR and made an issue to track that work item |
@astoycos if possible, please paste a link to the tracking issue created here, so we can located from this pr. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Removes/ converts all (that I'm aware of) nb/sbctl calls and converts them to use libovsdb. (except for #2574) This is mostly completed by adding helper functions to libovsdbops package. Its also moves the libovsdbops package to go-controller/pkg since its used by many packages in that directory, not just the OVN package
TODO:
ovn-kube-util
readiness probe binary (I left it for now)